/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DAO;

import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Administrator
 */
public class DAOTest extends BaseDAO {

    private Connection con = getConnection();
    private ResultSet rs = null;
    private Statement stmt = null;

    public ResultSet selectTest(int id) {
        try {
            stmt = con.createStatement();
            rs = stmt.executeQuery("SELECT * FROM TEST WHERE SUBID = " + id + " and Status =1");

        } catch (SQLException ex) {
            Logger.getLogger(DAOTest.class.getName()).log(Level.SEVERE, null, ex);
        }
        return rs;
    }

    public ResultSet selectSubID(int id) {
        try {
            stmt = con.createStatement();
            rs = stmt.executeQuery("SELECT * FROM SUBSUBJECT WHERE SUBJECTID = " + id+ " and Status =1");

        } catch (SQLException ex) {
            Logger.getLogger(DAOTest.class.getName()).log(Level.SEVERE, null, ex);
        }
        return rs;
    }
    public ResultSet selectSubject() {
        try {
            stmt = con.createStatement();
            rs = stmt.executeQuery("SELECT * FROM Subject where status = 1");
        } catch (SQLException ex) {
            Logger.getLogger(DAOTest.class.getName()).log(Level.SEVERE, null, ex);
        }
        return rs;
    }

}
